﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Practices.Unity;
using System.Transactions;

namespace Skynet.BusinessLogic.Test.DataAccess
{
     [TestClass]
    public  class ExamTest
    {
        private static IUnityContainer Container;

        [ClassInitialize()]
        public static void Initialize(TestContext testContext)
        {

            Container = UnityHelper.BuildUnityContainer();
        }
        [TestMethod]
        public void ExamsCRUD()
        {
            //var repCat = Container.Resolve<BusinessLogic.DataAccess.IExamCategoryRepository>();
            //var repExam = Container.Resolve<BusinessLogic.DataAccess.IExamRepository>();
            //var examcat = new BusinessEntities.ExamCategory();
            //examcat.Id = Guid.NewGuid();
            //examcat.Title = "testTitle";
            //examcat.Description = "Description Test";

            //repCat.Add(examcat);

            //var exam = new BusinessEntities.Exam();
            //exam.Id = Guid.NewGuid();
            //exam.CategoryExamId = examcat.Id;
            //exam.Title = "test";
            //exam.Summary = "test";
            //repExam.Add(exam);

            //var target = repExam.GetOne(exam.Id);
            //Assert.IsNotNull(target);

            //exam.Summary = "change test";
            //repExam.Update(exam);

            //target = repExam.GetOne(exam.Id);

            //Assert.AreEqual<string>(target.Summary, "change test");

            //repExam.Delete(exam);
            //target = repExam.GetOne(exam.Id);
            //Assert.IsNull(target);



        }
    }
}
